<?php

/**
 * 图书错误举报
 */
class BookErrorAR extends CActiveRecord{
	public static function model($className=__CLASS__){
		return parent::model($className);
	}

	public static function tblName()	{
		return 'ccs8_book_error';
	}
	
	public function tableName()	{
		return self::tblName();
	}
	
	public static function saveBookError($fk_user,$user_name,$fk_book,$e_type,$do_ip,$e_desn){
		$ar = array(
			'fk_user'=>$fk_user,
			'user_name'=>$user_name,
			'fk_book'=>$fk_book,
			'e_type'=>$e_type,
			'do_ip'=>$do_ip,
			'e_desn'=>$e_desn,
			'ctime'=>time(),
		);		
		try{
			DBUtil::insert(self::tblName(),$ar);
			return 0;
		}catch(Exception $e){
			return 1;
		}
	}
}